Skip to content

add event_type_is_supported() for Publisher/Subscription.#3132

Open
fujitatomoya wants to merge 1 commit intorollingfrom
fujitatomoya/rmw/pull/395/followup
Open

add event_type_is_supported() for Publisher/Subscription.#3132
fujitatomoya wants to merge 1 commit intorollingfrom
fujitatomoya/rmw/pull/395/followup

Conversation

@fujitatomoya
Copy link
Copy Markdown
Collaborator

Description

depends on ros2/rcl#1317

Fixes # (issue)

Is this user-facing behavior change?

No

Did you use Generative AI?

Yes Claude Code Opus4.6

Additional Information

Signed-off-by: Tomoya Fujita <tomoya.fujita825@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a public runtime capability-check API to rclcpp so application code (and rclcpp tests) can determine whether specific publisher/subscription QoS event types are supported by the currently loaded RMW implementation, via PublisherBase/SubscriptionBase.

Changes:

  • Add PublisherBase::event_type_is_supported(rcl_publisher_event_type_t) and SubscriptionBase::event_type_is_supported(rcl_subscription_event_type_t) as public static APIs that forward to rcl support-check functions.
  • Update test_qos_event.cpp to use the new rclcpp APIs instead of rmw_event_type_is_supported(...).
  • Add unit tests asserting the rclcpp API results match the underlying rcl results.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rclcpp/test/rclcpp/test_qos_event.cpp Switches capability checks to the new rclcpp APIs and adds parity tests vs rcl.
rclcpp/src/rclcpp/subscription_base.cpp Implements SubscriptionBase::event_type_is_supported() by forwarding to rcl_subscription_event_type_is_supported().
rclcpp/src/rclcpp/publisher_base.cpp Implements PublisherBase::event_type_is_supported() by forwarding to rcl_publisher_event_type_is_supported().
rclcpp/include/rclcpp/subscription_base.hpp Declares the new public static capability-check API for subscriptions with Doxygen docs.
rclcpp/include/rclcpp/publisher_base.hpp Declares the new public static capability-check API for publishers with Doxygen docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator Author

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahcorde can you review this?

Comment on lines +77 to +78
if (rclcpp::PublisherBase::event_type_is_supported(RCL_PUBLISHER_OFFERED_DEADLINE_MISSED) &&
rclcpp::PublisherBase::event_type_is_supported(RCL_PUBLISHER_LIVELINESS_LOST))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now we have these APIs, so that call rclcpp APIs instead of rmws.

@fujitatomoya fujitatomoya requested a review from ahcorde April 15, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants